﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class UiModeSwitch : MonoBehaviour
{
    const int MODE_LOGIN = 1;
    const int MODE_NAVIGATION = 2;
    const int MODE_FOLLOW = 3;

    [Header("登录界面")]
    public GameObject UiLogin;
    [Header("导航界面")]
    public GameObject UiNavigation;
    [Header("跟随界面")]
    public GameObject UiFollow;
    
    [Header("全局灯光")]
    public Light LightAll;
    [Header("室内灯光")]
    public Light LightClass;

    public void SwitchMode(int mode)
    {
        switch (mode)
        {
            case MODE_LOGIN:
                UiFollow.SetActive(false);
                UiNavigation.SetActive(false);
                UiLogin.SetActive(true);
                break;
            case MODE_NAVIGATION:
                UiFollow.SetActive(false);
                UiNavigation.SetActive(true);
                UiLogin.SetActive(false);
                if (LightAll != null)
                {
                    //打开全局光照
                    LightAll.transform.gameObject.SetActive(true);
                }
                if(LightClass != null)
                {
                    //关闭教室灯光
                    LightClass.transform.gameObject.SetActive(false);
                }
                break;
            case MODE_FOLLOW:
                UiFollow.SetActive(true);
                UiNavigation.SetActive(false);
                UiLogin.SetActive(false);
                if (LightAll != null)
                {
                    //关闭全局光照
                    LightAll.transform.gameObject.SetActive(false);
                }
                if (LightClass != null)
                {
                    //打开教室灯光
                    LightClass.transform.gameObject.SetActive(true);
                }
                break;
        }
    }
}
